package com.zhenghaijin.recommendationservice.mapper;

import com.zhenghaijin.recommendationservice.model.UserRecommendation;
import org.apache.ibatis.annotations.*;

@Mapper
public interface UserRecommendationMapper {
    @Insert("REPLACE INTO user_recommendation(user_id, recommended_anime_ids, update_time) " +
            "VALUES (#{userId}, #{recommendedAnimeIds}, #{updateTime})")
    void upsert(UserRecommendation recommendation);

    @Select("SELECT * FROM user_recommendation WHERE user_id = #{userId}")
    UserRecommendation findByUserId(Long userId);
}